
/*
Replication of 
Pelc, Krzysztof and Joost Pauwelyn. 2025.
"Are WTO Rulings Biased? The Role of Institutional Design in Protecting Judicial Autonomy". 
World Politics. 
*/

* set dir to "WP_Replication" directory

use selection.dta

* test balance of treated vs. non-treated.
ttest numclaims, by(def_conational)
ttest disp_panel_won, by(def_conational)
ttest disp_panel_rulings, by(def_conational)

ttest numclaims, by(compl_conational)
ttest disp_panel_won, by(compl_conational)
ttest disp_panel_rulings, by(compl_conational)

probit is_chair c.US##c.US_resp c.EU##c.EU_resp  if selected==1, cluster(common)
probit is_chair c.US##c.US_compl c.EU##c.EU_compl  if selected==1, cluster(common)

* Table 1: Is the Assignment of ABMs to Divisions Random?

eststo clear

eststo: probit  selected def_conational compl_conational, cluster(common)
eststo: probit  selected US US_resp US_US_resp  EU EU_resp EU_EU_resp , cluster(common)
eststo: probit  selected US US_compl US_US_compl  EU EU_compl EU_EU_compl , cluster(common) 
 
esttab using "tableassignment.csv",  csv label se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars 


* Table Appendix A1: equivalent tst for chairs. 

eststo clear

eststo: probit 	is_chair US EU, cluster(common)
eststo: probit  is_chair def_conational compl_conational, cluster(common)
eststo: probit  is_chair US US_resp US_US_resp  EU EU_resp EU_EU_resp , cluster(common)
eststo: probit  is_chair US US_compl US_US_compl  EU EU_compl EU_EU_compl  , cluster(common)

esttab using "tableA1.csv",  csv label se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars 


* Bias tests

use bias.dta


* Table 4: Effect of AB Member Co-Nationals on AB Rulings

eststo clear

eststo: glm  disp_ab_prop_won ABM_def   disp_panel_prop_won bs* , link(logit) family(binomial) robust cluster(common)
eststo: glm  disp_ab_prop_won ABM_compl   disp_panel_prop_won bs* , link(logit) family(binomial) robust cluster(common)

eststo: glm  disp_ab_prop_won ABM_def   disp_panel_prop_won Ag AD SCM  SPS TBT   Third bs* , link(logit) family(binomial) robust cluster(common)
eststo: glm  disp_ab_prop_won ABM_compl   disp_panel_prop_won Ag AD SCM  SPS TBT   Third bs* , link(logit) family(binomial) robust cluster(common)

eststo: glm  disp_ab_prop_won ABM_def EU_resp ABM_defXEU_resp  disp_panel_prop_won Ag AD SCM  SPS TBT   Third bs* , link(logit) family(binomial) robust cluster(common)
eststo: glm  disp_ab_prop_won ABM_def US_resp ABM_defXUS_resp  disp_panel_prop_won Ag AD SCM  SPS TBT   Third bs* , link(logit) family(binomial) robust cluster(common)

eststo: glm  disp_ab_prop_won ABM_def sum_tradeofficial sum_lawyer sum_female sum_developing  disp_panel_prop_won Ag AD SCM  SPS TBT   Third bs* , link(logit) family(binomial) robust cluster(common)

eststo: glm  disp_ab_prop_won ABM_def  disp_panel_prop_won Ag AD SCM  SPS TBT   Third bs* if year>=2005 , link(logit) family(binomial) robust cluster(common)

esttab using "tablerulings.csv",  csv label se(3) b(3) replace star(+ 0.10 * 0.05 ** 0.01) compress nogaps nodepvars 


* Table 5: Effect of AB Co-National Chairs on AB Rulings

eststo clear

eststo: glm disp_ab_prop_won chair_def   disp_panel_prop_won bs*, link(logit) family(binomial) robust cluster(common)

eststo: glm disp_ab_prop_won chair_def  disp_panel_prop_won Ag AD SCM  SPS TBT  Third  bs* , link(logit) family(binomial) robust  cluster(common)
	margins , at(chair_def = (0 1))
	di (.7112227  -  .5021227 )/.7112227  

eststo: glm disp_ab_prop_won chair_def  disp_panel_prop_won Ag AD SCM  SPS TBT  Third Saab-Zhao bs* , link(logit) family(binomial) robust  cluster(common)

eststo: glm disp_ab_prop_won chair_def  disp_panel_prop_won  abm1_trade_official abm1_lawyer abm1_female abm1_developing_country Ag AD SCM  SPS TBT  Third   bs* , link(logit) family(binomial) robust  cluster(common)

eststo: glm disp_ab_prop_won chair_def  disp_panel_prop_won Ag AD SCM  SPS TBT  Third  bs* if year>=2005 , link(logit) family(binomial) robust  cluster(common)

esttab using "tablechairs.csv",  csv label se(3) b(3) replace star(* 0.10 ** 0.05 *** 0.01) compress nogaps nodepvars 


* Table 6: Estimating the Odds of AB Dissenting Opinions

eststo clear

eststo: probit AB_dissent ABM_def disp_ab_prop_won   bs* , cluster( common)

eststo: probit AB_dissent ABM_def disp_ab_prop_won disp_panel_prop_won Ag AD SCM  SPS TBT Third bs* , cluster( common)
margins , at(ABM_def = (0 1))
 di .1330715  / .0223357 

eststo: probit AB_true_dissent ABM_def disp_ab_prop_won   bs* , cluster( common)

eststo: probit AB_true_dissent ABM_def disp_ab_prop_won disp_panel_prop_won Ag AD SCM  Third bs* , cluster( common)
margins , at(ABM_def = (0 1))
	di .1063274  / .0073924

esttab using "tabledissents.csv",  csv label se(3) b(3) replace star(* 0.10 ** 0.05 *** 0.01) compress nogaps nodepvars 

* end *










